
const operate = {
  install(Vue) {
    Vue.directive('operate', {
      inserted(el, binding, vnode) {
        const path = window.location.hash.slice(1).split('?')[0],
          { value } = binding,
          power = JSON.parse(window.sessionStorage.power),
          operate = power[path] || {}
        if (!operate[value]) {
          el.parentNode && el.parentNode.removeChild(el)
        }
      }
    })
  }
}
export default operate
